package com.ohs.ohsoa.system.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ohs.ohsoa.system.dto.OvertimeLeaveStatisticsDto;
import com.ohs.ohsoa.system.service.OvertimeLeaveStatisticService;
import com.ohs.ohsoa.utils.auth.UserLoginToken;
import com.ohs.ohsoa.utils.bean.responseBean.ResultBean;
import com.ohs.ohsoa.system.vo.OvertimeLeaveStatisticsVo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(value = "加班欠勤统计", tags = "加班欠勤统计")
@RestController
@RequestMapping("/overtimeleavestatistics")
public class OvertimeleavestatisticsController {

    @Resource
    private OvertimeLeaveStatisticService overtimeLeaveStatisticService;

    /**
     * 获取加班欠勤统计详细信息
     *
     * @param overtimeLeaveStatisticsDto 欠勤统计详细信息数据
     * @return olsYear, userGuid 必传
     */
    @PostMapping(value = "/select")
    @ApiOperation(httpMethod = "POST", value = "获取加班欠勤统计详细信息")
    public ResultBean<OvertimeLeaveStatisticsVo> overtimeleavestatisticsSelect(@RequestBody OvertimeLeaveStatisticsDto overtimeLeaveStatisticsDto) {
        return ResultBean.success(overtimeLeaveStatisticService.overtimeleavestatisticsSelect(overtimeLeaveStatisticsDto));
    }

    /**
     * 获取个人加班请假时长
     *
     * @param overtimeLeaveStatisticsDto 欠勤统计详细信息数据
     * @return beginTime, endTime 必传 oliFlag 可为 ”“
     */
    @UserLoginToken
    @PostMapping(value = "/overtimeleaveinfocount")
    @ApiOperation(httpMethod = "POST", value = "获取个人加班请假时长")
    public ResultBean<?> overtimeleaveinfocount(
            @RequestBody OvertimeLeaveStatisticsDto overtimeLeaveStatisticsDto) {
        return ResultBean.success(overtimeLeaveStatisticService.overtimeleaveinfocount(overtimeLeaveStatisticsDto));
    }

}
